package com.iams.elasticsearch.repository;

import com.iams.elasticsearch.domain.ElasticsearchArchive;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;


import java.util.List;

@Repository
public interface ArchiveRepository extends ElasticsearchRepository<ElasticsearchArchive, Long> {

    // 根据标题或内容搜索
    List<ElasticsearchArchive> findByTitleContainingOrContentContaining(String title, String content);

    // 根据内容查询
    List<ElasticsearchArchive> findByContent(String content);

    // 根据文件类型和内容搜索
    List<ElasticsearchArchive> findByFileTypeAndContentContaining(String fileType, String content);

    // 根据保密级别和内容搜索
    List<ElasticsearchArchive> findBySecretLevelAndContentContaining(String secretLevel, String content);

    void deleteById(String id); // 将参数类型改为 String
}


